#ifndef __ADD_IPC_WIDGET_INCLUDE__
#define __ADD_IPC_WIDGET_INCLUDE__
#include "ui_AddIPCWidget.h"
#include "IPC_Manager.h"
#include <QDialog>
#include <QJsonObject>

class AddIPCWidget :public QDialog {
	Q_OBJECT
public:
	AddIPCWidget(IPCManager*mgr , QString oldUID = "" ,  QWidget* parent = NULL);
	virtual ~AddIPCWidget();
signals:
	void AddNewIPC(QJsonObject device);
	void ModifyIPC(QString OldUID, QJsonObject NewDevice); 

private slots:
	void onAddIPC();
	void AutoCap_stateChanged(int state);

private:
	void ShowErrorMessage(const QString& text);
	void initNewNodeEnv();
	void initOldNodeEnv(QString uid);

private:
	Ui::FormAddIPCWidget ui;
	IPCManager* ipc_mgr;
	QString oldDevUID;
	bool IsAddNewNode;
};

#endif